# -*- coding: utf-8 -*-
import os
import ix
from liberHook.BaseHook import BaseHook


class Hook(BaseHook):
    def __init__(self, library, directory, ext, start, end):
        BaseHook.__init__(self, library, directory, ext, start, end)

    def execute(self):
        if os.path.isfile(self.file):
            ix.import_project(str(self.file))
        else:
            self.append_error("%s is not an exist file." % self.file)
